# for module compiling
import os
from building import *

components = ['common',
              'parameter',
              'file_manager',
              'uITC',
              'SITL',
              'serial_manager',
              'mavproxy',
              'logger',
              'pid',
              'motor',
              'rc_channel',
              'storage_manager',
              'mc_attitude_control',
              'arming',
              'mc_position_control',
              'ahrs',
              'board_config',
              'sensor_imu',
              'device_manager'
             ]

objs = []
cwd  = GetCurrentDir()
list = os.listdir(cwd)

for item in list:
    if not item in components:
        continue

    if os.path.isfile(os.path.join(cwd, item, 'SConscript')):
        objs = objs + SConscript(os.path.join(item, 'SConscript'))

Return('objs')
